import request from '@/utils/request'

export function listAd(query) {
  return request({
    url: '/ad/list',
    method: 'get',
    params: query
  })
}

export function createAd(data) {
  return request({
    url: '/ad/create',
    method: 'post',
    data
  })
}

export function readAd(data) {
  return request({
    url: '/ad/read',
    method: 'get',
    data
  })
}

export function updateAd(data) {
  return request({
    url: '/ad/update',
    method: 'post',
    data
  })
}

export function deleteAd(data) {
  return request({
    url: '/ad/delete',
    method: 'post',
    data
  })
}

// banner列表
export function queryBannerList(query) {
  return request({
    url: '/AdminBannerConfig/queryBannerList',
    method: 'get',
    params: query
  })
}

// 添加banner
export function addBanner(data) {
  return request({
    url: '/AdminBannerConfig/addBanner',
    method: 'post',
    data
  })
}

// 查询所属分类
export function queryCategoryList(query) {
  return request({
    url: '/AdminBannerConfig/queryCategoryList',
    method: 'get',
    params: query
  })
}
// 编辑banner
export function updateBanner(data) {
  return request({
    url: '/AdminBannerConfig/updateBanner',
    method: 'post',
    data
  })
}
// 删除banner
export function deleteBannerById(params) {
  return request({
    url: '/AdminBannerConfig/deleteBannerById',
    method: 'get',
    params: params
  })
}
